.class public Lcom/flyfish/moregames/ExitView;
.super Ljava/lang/Object;
.source "ExitView.java"


# static fields
.field private static showTime:Ljava/util/Date;


# instance fields
.field private context:Landroid/content/Context;

.field private view:Landroid/view/View;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    .line 20
    new-instance v0, Ljava/util/Date;

    const/16 v1, 0x70

    const/4 v2, 0x6

    const/16 v3, 0x14

    invoke-direct {v0, v1, v2, v3}, Ljava/util/Date;-><init>(III)V

    sput-object v0, Lcom/flyfish/moregames/ExitView;->showTime:Ljava/util/Date;

    .line 18
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 9
    .parameter "context"

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 24
    iput-object p1, p0, Lcom/flyfish/moregames/ExitView;->context:Landroid/content/Context;

    .line 25
    new-instance v5, Ljava/util/Random;

    invoke-direct {v5}, Ljava/util/Random;-><init>()V

    .line 26
    .local v5, rand:Ljava/util/Random;
    const/16 v7, 0xa

    invoke-virtual {v5, v7}, Ljava/util/Random;->nextInt(I)I

    move-result v2

    .line 27
    .local v2, index:I
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    sget-object v8, Lcom/flyfish/moregames/untils/MoreGameConstant;->game_icon:[I

    aget v8, v8, v2

    invoke-static {v7, v8}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 28
    .local v1, bitmap:Landroid/graphics/Bitmap;
    sget-object v7, Lcom/flyfish/moregames/untils/MoreGameConstant;->game_info:[Ljava/lang/String;

    aget-object v0, v7, v2

    .line 29
    .local v0, appInfo:Ljava/lang/String;
    const-string v7, "layout_inflater"

    invoke-virtual {p1, v7}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/view/LayoutInflater;

    .line 30
    .local v3, inflater:Landroid/view/LayoutInflater;
    const/high16 v7, 0x7f03

    const/4 v8, 0x0

    invoke-virtual {v3, v7, v8}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v7

    iput-object v7, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    .line 31
    iget-object v7, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    const/high16 v8, 0x7f08

    invoke-virtual {v7, v8}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/ImageView;

    .line 32
    .local v4, iv:Landroid/widget/ImageView;
    invoke-virtual {v4, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 33
    iget-object v7, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    const v8, 0x7f080001

    invoke-virtual {v7, v8}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v6

    check-cast v6, Landroid/widget/TextView;

    .line 34
    .local v6, tv:Landroid/widget/TextView;
    invoke-virtual {v6, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 35
    iget-object v7, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    new-instance v8, Lcom/flyfish/moregames/ExitView$1;

    invoke-direct {v8, p0, v2}, Lcom/flyfish/moregames/ExitView$1;-><init>(Lcom/flyfish/moregames/ExitView;I)V

    invoke-virtual {v7, v8}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 42
    return-void
.end method

.method static synthetic access$0(Lcom/flyfish/moregames/ExitView;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 71
    invoke-direct {p0, p1}, Lcom/flyfish/moregames/ExitView;->showGameInfo(Ljava/lang/String;)V

    return-void
.end method

.method public static isShowTime()Z
    .locals 2

    .prologue
    .line 63
    new-instance v0, Ljava/util/Date;

    invoke-direct {v0}, Ljava/util/Date;-><init>()V

    .line 64
    .local v0, nowTime:Ljava/util/Date;
    sget-object v1, Lcom/flyfish/moregames/ExitView;->showTime:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/util/Date;->after(Ljava/util/Date;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 66
    const/4 v1, 0x1

    .line 68
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method private showGameInfo(Ljava/lang/String;)V
    .locals 4
    .parameter "packageName"

    .prologue
    .line 73
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "market://details?id="

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    .line 74
    .local v1, uri:Landroid/net/Uri;
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 75
    .local v0, intent:Landroid/content/Intent;
    iget-object v2, p0, Lcom/flyfish/moregames/ExitView;->context:Landroid/content/Context;

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 76
    return-void
.end method


# virtual methods
.method public getView()Landroid/view/View;
    .locals 2

    .prologue
    .line 46
    new-instance v0, Ljava/util/Date;

    invoke-direct {v0}, Ljava/util/Date;-><init>()V

    .line 47
    .local v0, nowTime:Ljava/util/Date;
    sget-object v1, Lcom/flyfish/moregames/ExitView;->showTime:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/util/Date;->after(Ljava/util/Date;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 49
    iget-object v1, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    .line 53
    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public getViewNoTimeLimit()Landroid/view/View;
    .locals 1

    .prologue
    .line 58
    iget-object v0, p0, Lcom/flyfish/moregames/ExitView;->view:Landroid/view/View;

    return-object v0
.end method
